<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html  xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:p="http://primefaces.prime.com.tr/ui"
       xmlns:c="http://java.sun.com/jsp/jstl/core">

    <body>

        <ui:composition template="./Test.xhtml">



            <ui:define name="content">

                <fieldset style="height: 300px">
                    <legend><b>Add new Category</b></legend>
              
                    <table width="668" height="238" border="0">
                        <tr>
                            <td><b>Category Name*</b></td>
                            <td><p:inputText id="catname" value="#{categoryBean.cat.categoryName}" required="true" requiredMessage="Category name is not null" >
                                    <f:ajax execute="catname" listener="#{categoryBean.checkCategoryName}" event="change" render=""/>
<!--                                    <f:validator validatorId="Validator.StringValidator"/>-->
                                </p:inputText></td>
                            <td> <h:outputText id="display" value="#{categoryBean.erroMs}" style="font-size: smaller;font-weight: normal;color: red"/></td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td><h:commandButton action="Category" actionListener="#{categoryBean.insertCategory}" value="Add new" type="image" image="../resources/images/forms/form_submit.gif"></h:commandButton>
                                <h:commandButton value="Cancel" action="AdminHome" type="image" image="../resources/images/forms/form_reset.gif"/>
                                <h:messages for="txtcatName" id="msg"/></td>
                            <td>&nbsp;</td>
                        </tr>
                        
                    </table>
                </fieldset>

            </ui:define>


        </ui:composition>

    </body>
</html>
